package com.turing.mission.feign;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import result.Result;

@FeignClient("merchant-server")
public interface MerchantService {

    @GetMapping("/merchant/mer/getMerById")
    Result getMerById(@RequestParam(value = "id") String id);

    @PatchMapping("/merchant/mer/merEdit")
    Result merEdit(@RequestBody JSONObject jsonObject);

    @GetMapping("/merchant/good/geGoodById")
    Result geGoodById(@RequestParam(value = "id") String id);

    @GetMapping("/merchant/good/myGoodList")
    Result myGoodList(@RequestHeader("Authorization") String token,
            @RequestParam(value = "merchantId",required = false) String merchantId,
            @RequestParam(value = "gdId",required = false) String gdId,
            @RequestParam(value = "cgState",required = false) Integer cgState,
            @RequestParam(value = "gdCreateTime",required = false) String gdCreateTime,
            @RequestParam(value = "pageNum",required = false) Integer pageNum,
            @RequestParam(value = "pageSize",required = false) Integer pageSize
    );

    @GetMapping("/merchant/admin/adminList")
    Result adminList(
            @RequestParam(value = "merchantId") String merchantId,
            @RequestParam(value = "cusNickname",required = false) String cusNickname,
            @RequestParam(value = "cusInfo",required = false) String cusInfo,
            @RequestParam(value = "sortType",defaultValue = "0") Integer sortType,
            @RequestParam(value = "orderType",defaultValue = "0") Integer orderType,
            @RequestParam(value = "pageNum",required = false) Integer pageNum,
            @RequestParam(value = "pageSize",required = false) Integer pageSize
    );

}
